<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
	<a4j:outputPanel id="jornadaTrabalhoChangePanel" ajaxRendered="true">
		<h:messages id="messages" globalOnly="true" styleClass="message"
	            	errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"
	            	rendered="#{showGlobalMessages != 'false'}"/>
		<h:form>
			<rich:panel styleClass="rich-stglpanel-body">
				<f:facet name="header">#{messages['label.jornadas.trabalho']}</f:facet>
				<s:decorate template="/layout/edit.xhtml">
					<ui:define name="label">#{messages['label.descricao']}</ui:define>
					<h:inputText 
						value="#{jornadaTrabalhoAction.entity.descricao}" 
						label="#{messages['label.descricao']}" 
						required="true"
						size="50" 
						onkeyup="toUpperCase(this,'')">
					</h:inputText>
				</s:decorate>
				<s:decorate template="/layout/edit.xhtml">
					<ui:define name="label">#{messages['label.horas.trabalho']}</ui:define>
					<h:inputText 
						value="#{jornadaTrabalhoAction.entity.horasTrabalho}" 
						label="#{messages['label.horas.trabalho']}" 
						required="true"
						size="5"
						maxlength="2" >
					</h:inputText>
				</s:decorate>
				<s:decorate template="/layout/edit.xhtml">
					<ui:define name="label">#{messages['label.horas.descanso']}</ui:define>
					<h:inputText 
						value="#{jornadaTrabalhoAction.entity.horasDescanso}" 
						label="#{messages['label.horas.descanso']}" 
						required="true"
						size="5"
						maxlength="2" >
					</h:inputText>
				</s:decorate>
			</rich:panel>
			<div>
				<a4j:commandButton 
					value="#{messages['label.salvar']}" 
					action="#{jornadaTrabalhoAction.save}"
					rendered="#{jornadaTrabalhoAction.entity.id == null}"
					reRender="jornadaTrabalhoChangePanel,jornadaTrabalhoListPanel"
					limitToList="true"/>
					
				<a4j:commandButton 
					value="#{messages['label.atualizar']}" 
					action="#{jornadaTrabalhoAction.update}"
					rendered="#{jornadaTrabalhoAction.entity.id != null}"
					reRender="jornadaTrabalhoChangePanel,jornadaTrabalhoListPanel"
					limitToList="true"/>
					
				<a4j:commandButton 
					value="#{messages['label.remover']}" 
					action="#{jornadaTrabalhoAction.remove}"
					rendered="#{jornadaTrabalhoAction.entity.id != null}"
					reRender="jornadaTrabalhoChangePanel,jornadaTrabalhoListPanel"
					limitToList="true"/>
					
				<s:button 
					propagation="none" 
					action="#" 
					value="#{messages['label.limpar']}">
				</s:button>
			</div>
		</h:form>
	</a4j:outputPanel>
</ui:fragment>
